/**
 * Created by Administrator on 2017/7/7 0007.
 */
define([],function() {
    var tpl={};
    tpl.hdfpInit=function(){
        var html = '';
        html += hdfpInitPage();
        return html;
    };
    tpl.init=function(){
        var html = '';
        html += hdfpList();
        return html;
    };
    tpl.init2=function(){
        var html = '';
        html += doctorRole();
        return html;
    };
    var hdfpInitPage=function(){
        return '<script id="hdfpInit-tpl" type="text/html">' +
            '<div class="clear input-list box">'+
                '<div class="col-md-4 col-sm-6" ><label for="queue-name" class="col-label"><span>*</span>队列名称</label>'+
                    '<div class="col-input">'+
                        '<input type="text" class="form-control" id="queue-name" placeholder="队列名" value="{{queueName}}">'+
                    '</div>'+
                '</div>'+
                '<div class="col-md-4 col-sm-6">'+
                    '<label class="col-label"><span>*</span>用户类型</label>'+
                    '<div class="col-input">'+
                        '<select class="form-control" id="user-type">'+
                            '{{if queueUsertype == 1}}'+
                            '<option value="0" name="user-type" >宝宝</option>'+
                            '<option value="1" name="user-type" selected>妈妈</option>'+
                            '<option value="2" name="user-type" >添加时选择</option>'+
                            '{{else if queueUsertype == 2}}'+
                            '<option value="0" name="user-type" >宝宝</option>'+
                            '<option value="1" name="user-type">妈妈</option>'+
                            '<option value="2" name="user-type"  selected>添加时选择</option>'+
                            '{{else}}'+
                            '<option value="0" name="user-type" selected>宝宝</option>'+
                            '<option value="1" name="user-type" >妈妈</option>'+
                            '<option value="2" name="user-type" >添加时选择</option>'+
                            '{{/if}}'+
                        '</select>'+
                     ' </div>'+
                '</div>'+
                '<div class="col-md-4 col-sm-6" id="followup-hdfp"></div>'+
                    '<div class="col-md-4 col-sm-6">'+
                    '<label for="queue-number" class="col-label label-none"><span>*</span>目标人数</label>'+
                    '<div class="col-input">'+
                        '<input type="text" class="form-control" id="queue-number" placeholder="目标人数" currNum="{{currNum}}" value="{{targetNum}}">'+
                    '</div>'+
                '</div>'+
                '<div class="col-md-12 col-sm-12"><label class="col-label label-none col-label-intro"><span>*</span>队列简介</label>'+
                    '<div class="col-input col-input-intro"><textarea class="form-control" rows="3" id="textarea">{{queueIntro}}</textarea></div>'+
                '</div>'+
            '</div>'+
            '<div class="input-list logo">'+
                '<div class="col-md-12 col-sm-12">'+
                    '<label class="col-label label-none col-label-intro"><span>*</span>队列logo</label>'+
                    '<div class="col-input col-logo">'+
                        '<form enctype="multipart/form-data" id="myForm">'+
                        '<input type="file" class="form-control logo-update" id="queue-logo" placeholder="队列Logo">'+
                        '<div class="logo-update" id="logo-click">'+
                            '<i class="fa fa-plus" aria-hidden="true"></i><br/>'+
                            '点击上传logo'+
                        '</div>'+
                        '</form>'+
                   ' </div>'+
                '</div>'+
            '</div>'+
        '</script>';
    };
    var hdfpList=function(){
        return '<script id="hdfplist-tpl" type="text/html">' +
                '<label class="col-label"><span>*</span>随访方案</label>'+
                '<div class="col-input">'+
                    '<select class="form-control">'+
                        '<option value="" name="hdfp">--请先选择随访方案--</option>'+
                        '{{each rows as value }}'+
                        '{{if schemeId == value.schemeId}}'+
                        '<option value="{{value.schemeId}}" schemeVersion="{{value.schemeVersion}}" name="hdfp" selected>{{value.schemeName}}</option>'+
                        '{{else}}'+
                        '<option value="{{value.schemeId}}" schemeVersion="{{value.schemeVersion}}" name="hdfp">{{value.schemeName}}</option>'+
                        '{{/if}}'+
                        '{{/each}}'+
                    '</select>'+
                '</div>'+
        '</script>';
    };
    var doctorRole=function(){
        return '<script id="doctorRole-tpl" type="text/html">' +
            '{{each data as value,i }}'+
                '{{if i=="0"}}'+
                '<tr doctorId="{{value.doctorId}}">'+
                    '<td></td>'+
                    '<td>{{value.doctorName}}</td>'+
                    '<td>管理员</td>'+
                '</tr>'+
                '{{else}}'+
                '<tr  doctorId="{{value.doctorId}}">'+
                    '<td><input type="checkbox" name="isCheck"></td>'+
                    '<td>{{value.doctorName}}</td>'+
                    '<td>' +
                    '<select class="form-control">'+
                    '{{each value.roles as roleMy }}'+
                    '{{if value.role == roleMy.paramCode}}'+
                    '<option value="{{roleMy.paramCode}}" name="doctor-role" selected>{{roleMy.paramName}}</option>'+
                    '{{else}}'+
                    '<option value="{{roleMy.paramCode}}" name="doctor-role">{{roleMy.paramName}}</option>'+
                    '{{/if}}'+
                    '{{/each}}'+
                    '</select>'+
                    '</td>'+
                '</tr>'+
                '{{/if}}'+
            '{{/each}}'+
            '</script>';
    }
    return tpl;
});

